﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using AttributeGroupsClassLIB;
using UtilityClassLIB;

namespace AttributesGroupsServiceLibrary
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in both code and config file together.
    public class AttributeGroupsService1 : IAttributeGroupsService1
    {

        AttributesGroupClass agc = new AttributesGroupClass();
        UtilityClass utility_obj = new UtilityClass();
        String connectionString = UtilityClass.ConnectionString();

//----------Attribute to Group -------------------------------------
        public DataTable FillDataTable(string dtb)
        {
            DataTable dt = new DataTable();
            dt = utility_obj.fillDataTable(dtb);
            return dt;
        }


        public string InsertRowinAttributeGroupTable(string groupname, string attributename, int gaValue, string agd)
        {
            string results = "";
            results = agc.InsertRowinAttributeGroupTable(groupname, attributename, gaValue, agd);
            return results;
        }

//---------------------Session -------------------------------------------

        public DataTable GetHighestRankedUserAttributes(int userid)
        {
            DataTable userAttributesbyUserID = new DataTable();
            userAttributesbyUserID = agc.GetHighestRankedUserAttributes(userid);
            return userAttributesbyUserID;
        }

        public DataTable GetUserAttributes(string username)
        {
            DataTable userAttributesbyUserID = new DataTable();
            //  userAttributesbyUserID = agc.GetUserAttributes(userid);
            return userAttributesbyUserID;
        }

        public string GetUser(int userid)
        {
            string userinfo = "";
            userinfo = agc.GetUser(userid);
            return userinfo;
        }

        public DataTable GetGroups(int userid)
        {
            DataTable userGroupsbyUserID = new DataTable();
            userGroupsbyUserID = agc.GetGroups(userid);
            return userGroupsbyUserID;
        }

        public DataTable GetAttributes(int userid)
        {
            DataTable userAttributesbyUserID = new DataTable();
            userAttributesbyUserID = agc.GetAttributes(userid);
            return userAttributesbyUserID;
        }

    }//end class
}//end namespace
